<%@ page import="com.entity.Recruitment" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.entity.Page" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/3/16
  Time: 17:36
  这是管理员管理公告的界面
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%
    String path=request.getContextPath();
    String basePath=request.getScheme()+"：//"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <title>后台管理系统</title>
    <link rel="stylesheet" href="/style/mycss.css" type="text/css">
</head>
<body>
<script type="text/javascript">
    function changeCurrentPage() {
        var text=document.getElementById("currentPageText");
        window.location="gotoGGGL?pagenumber="+text.value;
    }
</script>

<%@include file="../../../adminGuide.jsp" %>

<span class="blank8"></span>
<div id="wrapper">
    <div>
        <div class="areaSideBar clearfix" style="background-color: #fcfcfc;">
            <div class="titleBar ui_s4">
                <h2>
                    公告列表
                </h2>
            </div>
            <div style="margin: 15px; min-height: 400px; _height: 400px;">
                <div style="height: 550px; width: 965px; overflow: auto;">
                    <table class="tb01" style="width: 999px">
                        <thead>
                        <th style="width: 55px">
                            公告代码ID
                        </th>
                        <th style="width: 70px">
                            部门名称
                        </th>
                        <th style="width: 70px">
                            职位名称
                        </th>
                        <th style="width: 28px">
                            招考人数
                        </th>
                        <th style="width: 28px">
                            考试类别
                        </th>
                        <th style="width: 28px">
                            月薪
                        </th>
                        <th style="width: 240px;">
                            要求
                        </th>
                        <th style="width: 240px;">
                            工作内容
                        </th>
                        <th style="width: 80px">
                            发布日期
                        </th>
                        <th style="width: 80px">
                            截止日期
                        </th>
                        <th style="width: 80px">
                            操作
                        </th>
                        </thead>
                        <tbody>
                        <%
                            List list=(List)session.getAttribute("messageList");
                            Iterator iterator=list.iterator();
                            Recruitment r;
                            while (iterator.hasNext()){
                                r=(Recruitment) iterator.next();
                        %>
                        <tr>
                            <td><%=r.getId()%></td>
                            <td><%=r.getDepartment()%></td>
                            <td><%=r.getPost()%></td>
                            <td><%=r.getNeednumbers()%></td>
                            <td><%=r.getExamtype()%></td>
                            <td><%=r.getWage()%></td>
                            <td><%=r.getRequirement()%></td>
                            <td><%=r.getContent()%></td>
                            <td><%=r.getPublishdate()%></td>
                            <td><%=r.getDateline()%></td>
                            <td><input type="button" value="删除" onclick="
                                    if(confirm('确认删除改公告，该操作完成后无法撤回')){
                                window.location='deleteGonggao?id='+<%=r.getId()%>;
                                }" /> </td>
                        </tr>
                        <%
                            };
                        %>
                        </tbody>
                    </table>
                    <%--
                        分页的动作
                    --%>
                    <form action="gotoGGGL" method="post">
                        <div >
                            <%
                                Page pages=(Page)session.getAttribute("pages");
                            %>
                            共 <b><%=pages.getTotalNumber()%></b> 条
                            <%
                                if(pages.getCurrentPage()!=1){
                            %>
                            <a href="gotoGGGL?pagenumber=1" >首页</a>
                            <a href="gotoGGGL?pagenumber=<%=pages.getCurrentPage()-1%>">上一页</a>
                            <%
                                }
                            %>
                            当前第<span><%=pages.getCurrentPage()%>/<%=pages.getTotalPage()%></span>页
                            <%
                                if(pages.getCurrentPage()!=pages.getTotalPage()){
                            %>
                            <a href="gotoGGGL?pagenumber=<%=pages.getCurrentPage()+1%>">下一页</a>
                            <a href="gotoGGGL?pagenumber=<%=pages.getTotalPage()%>">末页</a>
                            <%
                                }
                            %>
                            跳至&nbsp;<input id="currentPageText" name="currentPage"type='text' value='<%=pages.getCurrentPage()%>'/>&nbsp;页&nbsp;
                            <input type="button" value="Go" onclick="changeCurrentPage()"/>
                            <input type="button" value="添加公告" onclick="window.location='gotoAddGG';"/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
